define([ "PDAppDir/properties", "CkPlayer" ], function(Properties, CkPlayer) {
	function getQueryString(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
		var r = window.location.search.substr(1).match(reg);
		if (r != null)
			return unescape(r[2]);
		return null;
	}
	HomeApp.controller('BodyCtrl', [ "$scope", function($scope) {
		$scope.cache = {
			id: getQueryString("id"),
			path: Properties.URL_FILE_SERVER_URL + getQueryString("path"),
			videoIntroduce: unescape(getQueryString("videoIntroduce"))
		};
//		$scope.cache = {
//			id: "abcd",
//			path: getStaticPath() + "/modules/ckplayer6.7/ckplayer/ckplayer.swf",
//			videoIntroduce: "this is remark"
//		};
		function loadedHandler() {
			// console.info('加载已完成')
		}
		var playswf = getStaticPath() + "/modules/ckplayer6.7/ckplayer/ckplayer.swf",
			flashvars = {
				f : 'http://movie.ks.js.cn/flv/other/1_0.flv',
				c : 0,
				e : 0,
				h : 4,
				my_url : encodeURIComponent(window.location.href),
				my_title : encodeURIComponent(document.title),
				loaded : 'loadedHandler',
				b : 0
			},
			params = {
				bgcolor : '#FFF',
				allowFullScreen : true,
				allowScriptAccess : 'always',
				wmode : 'transparent'
			},
//			video = [ 'http://movie.ks.js.cn/flv/other/1_0.mp4->video/mp4' ];
			video = [ $scope.cache.path ];
		CKobject.embed(playswf, 'video_play', 'ckplayer_a1', '100%', '100%', true,
				flashvars, video, params);
	} ]);
});